package com.shuyun.demo.delay;

import com.shuyun.demo.Demo01Message;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @description: 文档 https://www.iocoder.cn/Spring-Boot/RocketMQ/
 * @author: shuai.chen@shuyun.com
 * @date: 2022/10/10 3:26 PM
 */
@Slf4j
@Component
@RocketMQMessageListener(
        topic = Demo02Message.TOPIC_2,
        consumerGroup = "demo02-consumer-group-" + Demo02Message.TOPIC_2
)
public class Demo02Consumer2 implements RocketMQListener<Demo02Message> {

    @Override
    public void onMessage(Demo02Message message) {
        log.info("消费延迟消息:{}", message.getId());
    }

}
